# Replication Code For AJPS
library(foreign)
library(polycor)
library(plyr)
library(lavaan)
library(reshape2)
library(ggplot2)
library(car)
library(stringr)
library(stargazer)
library(mediation)
setwd("C:/Dropbox/Conspiracy/replication pen")


# Table 1

d1 <- read.csv("table 1 data.csv")[, -1]


d1[, str_sub(names(d1), -1) == "b"] <- llply(d1[, str_sub(names(d1), -1) == "b"] , 
                                                 function(i)
                                                   factor(i,
                                                          levels = c("Strongly Agree",
                                                                     "Agree",
                                                                     "Neither",
                                                                     "Disagree",
                                                                     "Strongly Disagree")))


# levels of agreement 
tab1 <- ldply(d1[, str_sub(names(d1), -1) == "b"], function(i) round(100 * prop.table(xtabs(V101.x ~ i, data = d1))))

tab1$var <- factor(c("Truther", 
                     "Birther",
                     "Financial Crisis",
                     "CFLB",
                     "Soros",
                     "Iraq War",
                     "Chemtrails"),
                   levels = c("Iraq War",
                              "Truther",
                              "Birther",
                              "Financial Crisis",
                              "Chemtrails",
                              "Soros",
                              "CFLB"))


tab1 <- tab1[order(tab1$var),]


# prior knowledge 

tab2 <- ldply(d1[, !str_sub(names(d1), -1) %in% c("x", "b")], function(i) round(100 * prop.table(xtabs(V101.x ~ i, data = d1))))


tab2$var <- factor(c("Truther", 
                     "Birther",
                     "Financial Crisis",
                     "CFLB",
                     "Soros",
                     "Iraq War",
                     "Chemtrails"),
                   levels = c("Iraq War",
                              "Truther",
                              "Birther",
                              "Financial Crisis",
                              "Chemtrails",
                              "Soros",
                              "CFLB"))

tab2 <- tab2[order(tab2$var),]


# bundling for the published table
print(cbind(tab2$var, tab2$Yes, tab1[, 2:6]))



# Previously Heard


# Exploratory factor analysis is performed with Stata file:  "polychoric correlations in stata.do" 

tab2 <- read.csv("table 2 data.csv")


cfa1 <- '
      # general dimension
      General_Conspiracy =~  fincrisis  +  fluorolights + vaportrail  + obamabirth  + sorosplot + iraqjews + truther911 

      
      # Ideolgical Dimension
      Ideological_Dimension =~ obamabirth  + sorosplot + iraqjews + truther911 
      '


cfa2 <- '

# general dimension
General_Conspiracy =~  fincrisis  +  fluorolights + vaportrail  + obamabirth  + sorosplot + iraqjews + truther911 


# liberal dimension
Liberal_Conspiracy =~ truther911 + iraqjews + fincrisis 

# conservative dimension
Conservative_Conspiracy =~ obamabirth +   sorosplot  + fluorolights 

'

res1 <- cfa(model = cfa1,
            orthogonal=T,
            ordered =  c("truther911", 
                         "obamabirth",
                         "fincrisis",
                         "fluorolights",
                         "sorosplot",
                         "iraqjews",
                         "vaportrail"),
            data = tab2)


res2 <- cfa(model = cfa2,
            orthogonal=T,
            ordered =  c("truther911", 
                         "obamabirth",
                         "fincrisis",
                         "fluorolights",
                         "sorosplot",
                         "iraqjews",
                         "vaportrail"),
            data = tab2)

summary(res1)
summary(res2)


# Figure 1 

f1 <- read.csv("figure 1 data.csv")[,-1]
head(f1)


smallvars <- c("truther911", "iraqjews")

conrecode <- llply(f1[, smallvars], 
                   function(i)
                   car::recode(i,
                              "
                                1 = 5;
                                2 = 4;
                                4 = 2;
                                5 = 1
                              ",
              as.factor.result = F))

names(conrecode) <- c("trutherrev", "iraqjewsrev")

f1 <- cbind(f1, conrecode)


df1 <- ddply(f1, .(CC342A.x),  function(i)
              data.frame(general = mean(c(i$fincrisis, i$fluorolights, i$vaportrails),na.rm=T),
                         ideological = mean(c(i$trutherrev, i$iraqjewsrev, i$obamabirth, i$sorosplot), na.rm = T)))


df1$CC342A.x <- factor(df1$CC342A.x, levels = levels(df1$CC342A.x)[c(8,2,6,3,5,1,7,4)]) 

df1m <- melt(df1, id = 1)
df1m <- df1m[-which(is.na(df1m$CC342A.x)),]
df1m <- df1m[-which(df1m$CC342A.x == "Not Sure"),]



df1m$CC342A.x <- factor(df1m$CC342A.x)

df1m$variable2 <- car::recode(df1m$variable,
                              "
                             'general' = 'General Conspiracies';
                             'ideological' = 'Ideological Conspiracies'")

df1m$CC342A.x1 <- car::recode(df1m$CC342A.x, 
                              "'Somewhat Liberal' = 'Somewhat\nLiberal';
                               'Middle of the Road' = 'Middle of\nthe Road';
                               'Somewhat Conservative' = 'Somewhat\nConservative';
                               'Very Conservative' = 'Very\nConservative'",
                              levels = levels(df1m$CC342A.x))


df1m$CC342A.x2 <- as.character(df1m$CC342A.x1)

df1m$CC342A.x2[df1m$CC342A.x2 == "Somewhat Liberal"] <- "Somewhat\nLiberal"
df1m$CC342A.x2[df1m$CC342A.x2 == "Middle of the Road"] <- "Middle of\nthe Road"
df1m$CC342A.x2[df1m$CC342A.x2 == "Somewhat Conservative"] <- "Somewhat\nConservative"
df1m$CC342A.x2[df1m$CC342A.x2 == "Very Conservative"] <- "Very\nConservative"

table(df1m$CC342A.x2)

df1m$CC342A.x2 <- factor(df1m$CC342A.x2, 
                         levels = c("Very Liberal",
                                    "Liberal",
                                    "Somewhat\nLiberal",
                                    "Middle of\nthe Road",
                                    "Somewhat\nConservative",
                                    "Conservative",
                                    "Very\nConservative"))

p2 <- ggplot(df1m) + 
      geom_line(aes(x = CC342A.x2, y = value, group = variable2, linetype = variable2)) +
      scale_x_discrete("") +
      scale_y_continuous("Mean Response (5pt scale)") +
      scale_linetype("")+
      theme(legend.position = "bottom",
            legend.direction = "horizontal")


# Not Run
# ggsave("figure 1-simple means of conspiracy across ideological spectrum.pdf", 
#        p2, 
#        width = 7, 
#        height = 4) 
# 



# Table 3

t3 <- read.csv("table 3 data.csv")

# Ghosts, Angels, Satan
# setting factors in the right order
t3[,c("CHI430", "CHI432", "CHI433")] <- llply(t3[,c("CHI430", "CHI432", "CHI433")],
                                              function(i)
                                              factor(i,
                                                     levels = c("Believe in",
                                                                "Not sure about",
                                                                "Don't believe in")))

tab3.1 <- ldply(t3[,c("CHI430", "CHI432", "CHI433")], function(i) round(100*prop.table(xtabs(V101 ~ i, data = t3))))
tab3.1$var <- c("Ghosts", "Angels", "Satan")

# Manichean, ESP, Secret Cabal, End Times
# setting factors in the right order
t3[,c( "CHI435", "CHI416", "CHI442b", "CHI453")] <- llply(t3[,c( "CHI435", "CHI416", "CHI442b", "CHI453")],
                                                          function(i)
                                                          factor(i,
                                                                 levels = c("Strongly agree",
                                                                            "Agree",
                                                                            "Neither agree nor disagree",
                                                                            "Disagree",
                                                                            "Strongly disagree")))
tab3.2 <- ldply(t3[,c("CHI435", "CHI416", "CHI442b", "CHI453")], function(i) round(100*prop.table(xtabs(V101 ~ i, data = t3))))
tab3.2$var <- factor(c("Manichean",
                       "Secret Cabal",
                       "End Times",
                       "ESP"),
                     levels = c("Manichean",
                                "ESP",
                                "Secret Cabal",
                                "End Times"))

tab3.2 <- tab3.2[order(tab3.2$var),]


# Table 4 

tab4 <- read.csv("table 4 data.csv")

t4.lm1 <- lm(theolscale ~ ednumeric + female + black + hispanic + 
                          libdum + consdum + demdum + gopdum + 
                          polintnum + psc + trustind1 + inteff + exteffic +
                          RWA + imprelnum, 
             data = tab4)

t4.lm2 <- lm(goodevil ~ ednumeric + female + black + hispanic + 
               libdum + consdum + demdum + gopdum + 
               polintnum + psc + trustind1 + inteff + exteffic +
               RWA + imprelnum, 
             data = tab4)


t4.lm3 <- lm(endtimes2 ~ ednumeric + female + black + hispanic + 
               libdum + consdum + demdum + gopdum + 
               polintnum + psc + trustind1 + inteff + exteffic +
               RWA + imprelnum, 
             data = tab4)

t4.lm4 <- lm(cabal ~ ednumeric + female + black + hispanic + 
               libdum + consdum + demdum + gopdum + 
               polintnum + psc + trustind1 + inteff + exteffic +
               RWA + imprelnum, 
             data = tab4)

t4.lm5 <- lm(paranormscale ~ ednumeric + female + black + hispanic + 
               libdum + consdum + demdum + gopdum + 
               polintnum + psc + trustind1 + inteff + exteffic +
               RWA + imprelnum, 
             data = tab4)

stargazer(t4.lm1,
          t4.lm2,
          t4.lm3,
          t4.lm4,
          t4.lm5,
          type = "text",
          omit.stat = c("ser", "rsq", "f"),
          covariate.labels  = c("Education",
                                "Female",
                                "Black",
                                "Hispanic",
                                "Liberal",
                                "Conservative",
                                "Democratic",
                                "Republican",
                                "Political Interest",
                                "Political Knowledge",
                                "Trust",
                                "Internal Efficacy",
                                "External Efficacy",
                                "Right Wing Authoritarianism",
                                "Importance of Religion"),
          dep.var.labels = c("Supernatural",
                             "Manichean",
                             "End Times",
                             "Secret Cabal",
                             "Paranormal"))




# Figure 2 

fig.2 <- read.csv("figure 2 data.csv")


fig.2.m.l <- llply(c("truther", "birther", "fincrisis.1", "fluoro", "soros", "vaportrails", "iraqjews.1"),
                   function(i)
                  lm(str_c(i, " ~   ednumeric + female + black + hispanic +
                                    libdum + consdum +
                                    demdum + gopdum +
                                    polintnum + psc +
                                    theolscale + 
                                    goodevil +
                                    endtimes2 +
                                    cabal +
                                    paranormscale +
                                    trustind1 +
                                    inteff +
                                    exteffic +
                                    RWA"), 
                     data = fig.2))



stargazer(fig.2.m.l[[1]],
          fig.2.m.l[[2]],
          fig.2.m.l[[3]],
          fig.2.m.l[[4]],
          fig.2.m.l[[5]],
          fig.2.m.l[[6]],
          fig.2.m.l[[7]],
          type = "text",
          omit.stat = c("ser", "rsq", "f"),
          covariate.labels  = c("Education",
                                "Female",
                                "Black",
                                "Hispanic",
                                "Liberal",
                                "Conservative",
                                "Democratic",
                                "Republican",
                                "Political Interest",
                                "Political Knowledge",
                                "Supernatural",
                                "Manichean",
                                "End Times",
                                "Secret Cabal",
                                "Paranormal",
                                "Trust",
                                "Internal Efficacy",
                                "External Efficacy",
                                "Right Wing Authoritarianism"),
          dep.var.labels = c("Truther",
                             "Birther",
                             "Fin.Crisis",
                             "CFLB",
                             "Soros",
                             "Chemical Trails",
                             "Iraq Wars"))


summary(fig.2.m.l[[1]])$coefficients[row.names(summary(fig.2.m.l[[1]])$coefficients) %in% 
                                      c("theolscale", "goodevil", "endtimes2", "cabal", "paranormscale"), 1:2]


gather.coefficients <- function(j){
    k <- summary(j)$coefficients[row.names(summary(fig.2.m.l[[1]])$coefficients) %in% 
                                        c("theolscale", "goodevil", "endtimes2", "cabal", "paranormscale"), 1:2]
  return(k)
}


fig.2.m.coef <- ldply(fig.2.m.l, function(i) gather.coefficients(i))
fig.2.m.coef$cp <- factor(c("S", "M", "E", "C", "P"),
                          levels = c("S", "M", "E", "C", "P"))
fig.2.m.coef$dv <- factor(rep(c("Truther", "Birther", "Fin.Crisis", "CFLB", "Soros", "ChemTrails", "Iraq War"),
                              times = 5),
                          levels = c("Truther",
                                     "Iraq War",
                                     "Fin.Crisis",
                                     "CFLB",
                                     "ChemTrails",
                                     "Soros",
                                     "Birther"))

fig.2.m.coef$lo <- fig.2.m.coef$Estimate - 1.96* fig.2.m.coef[,2]
fig.2.m.coef$hi <- fig.2.m.coef$Estimate + 1.96* fig.2.m.coef[,2]

fig.2.m.coef$sign <- ifelse((fig.2.m.coef$Estimate >= 0 & fig.2.m.coef$lo >= 0) |
                            (fig.2.m.coef$Estimate <= 0 & fig.2.m.coef$hi <= 0),
                            "sig", "insig")


ggplot() + geom_point(data = fig.2.m.coef,
                      aes(x = cp, y = Estimate),
                      size = 4) +
           geom_segment(data = fig.2.m.coef,
                        aes(x = cp, xend = cp,
                            y = lo, yend = hi)) +
            geom_hline(yintercept = 0, linetype = 3) +
            geom_point(data = fig.2.m.coef[fig.2.m.coef$sign == "insig",],
                       aes(x = cp, y = Estimate),
                       size = 3.5, color = "grey90") + 
           facet_wrap(~dv, nrow = 2) +
           labs(x = "Conspiratorial Predisposition",
                y = "Coefficient")


# Not Run 
# ggsave("figure 2 plot 2.png", width = 9, height = 7, dpi = 240)



# Figure 3 


fig3 <- read.csv("figure 3 data.csv")

endtimes.med <- lm(endtimes2 ~ ednumeric + female + black + hispanic +
                     libdum + consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA, data = fig3)

supernat.med <- lm(supernat ~ ednumeric + female + black + hispanic +
                     libdum + consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA, data = fig3)

cabal.med <- lm(cabal ~ ednumeric + female + black + hispanic +
                  libdum + consdum +
                  demdum + gopdum +
                  polintnum + psc +
                  trustind1 +
                  inteff +
                  exteffic +
                  RWA, data = fig3)

paranorm.med <- lm(paranormscale ~ ednumeric + female + black + hispanic +
                     libdum + consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA, data = fig3)

manichean.med <- lm(goodevil ~ ednumeric + female + black + hispanic +
                      libdum + consdum +
                      demdum + gopdum +
                      polintnum + psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA, data = fig3)


vap.ed <- lm(vaportrails ~ 
               ednumeric + female + black +hispanic +
               libdum + consdum +
               demdum + gopdum +
               polintnum + psc +
               trustind1 +
               inteff +
               exteffic +
               RWA +
               goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


vap.fem <- lm(vaportrails ~ 
                female + black +hispanic +
                libdum + consdum +
                demdum + gopdum +
                polintnum + psc +
                trustind1 +
                inteff +
                exteffic +
                RWA + ednumeric +
                theolscale +
                goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


vap.black <- lm(vaportrails ~ 
                  black +hispanic +
                  libdum + consdum +
                  demdum + gopdum +
                  polintnum + psc +
                  trustind1 +
                  inteff +
                  exteffic +
                  RWA + ednumeric +
                  theolscale + female +
                  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

vap.hispanic <- lm(vaportrails ~ 
                     hispanic +
                     libdum + consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

vap.libdum <- lm(vaportrails ~ 
                   libdum + consdum +
                   demdum + gopdum +
                   polintnum + psc +
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic +
                   goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


vap.consdum <- lm(vaportrails ~ 
                    consdum +
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum +
                    goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

vap.demdum <- lm(vaportrails ~ 
                   demdum + gopdum +
                   polintnum + psc +
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic + libdum + consdum +
                   goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



vap.gopdum <- lm(vaportrails ~ 
                   gopdum +
                   polintnum + psc +
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic + libdum + consdum + demdum +
                   goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


vap.polint <- lm(vaportrails ~ 
                   polintnum + psc +
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic + libdum + consdum + demdum + gopdum +
                   goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


vap.psc <- lm(vaportrails ~ 
                psc +
                trustind1 +
                inteff +
                exteffic +
                RWA + ednumeric +
                theolscale + female + black +
                hispanic + libdum + consdum + demdum + gopdum +
                polintnum +
                goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

vap.trust <- lm(vaportrails ~ 
                  trustind1 +
                  inteff +
                  exteffic +
                  RWA + ednumeric +
                  theolscale + female + black +
                  hispanic + libdum + consdum + demdum + gopdum +
                  polintnum + psc +
                  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



vap.inteff <- lm(vaportrails ~ 
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic + libdum + consdum + demdum + gopdum +
                   polintnum + psc +trustind1 +
                   goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



vap.exteff <- lm(vaportrails ~ 
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic + libdum + consdum + demdum + gopdum +
                   polintnum + psc +trustind1 + inteff +
                   goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


vap.RWA <- lm(vaportrails ~ 
                RWA + ednumeric +
                theolscale + female + black +
                hispanic + libdum + consdum + demdum + gopdum +
                polintnum + psc +trustind1 + inteff + exteffic +
                goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)




# this is what models truthers 

truth.ed <- lm(truther ~ 
                 ednumeric + female + black +hispanic +
                 libdum + consdum +
                 demdum + gopdum +
                 polintnum + psc +
                 trustind1 +
                 inteff +
                 exteffic +
                 RWA +
                 theolscale +
                 goodevil + endtimes2 + supernat + cabal + paranormscale               , data = fig3)

truth.fem <- lm(truther ~ 
                  female + black +hispanic +
                  libdum + consdum +
                  demdum + gopdum +
                  polintnum + psc +
                  trustind1 +
                  inteff +
                  exteffic +
                  RWA + ednumeric +
                  theolscale +
                  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


truth.black <- lm(truther ~ 
                    black +hispanic +
                    libdum + consdum +
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

truth.hispanic <- lm(truther ~ 
                       hispanic +
                       libdum + consdum +
                       demdum + gopdum +
                       polintnum + psc +
                       trustind1 +
                       inteff +
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

truth.libdum <- lm(truther ~ 
                     libdum + consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


truth.consdum <- lm(truther ~ 
                      consdum +
                      demdum + gopdum +
                      polintnum + psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale + female + black +
                      hispanic + libdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

truth.demdum <- lm(truther ~ 
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



truth.gopdum <- lm(truther ~ 
                     gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


truth.polint <- lm(truther ~ 
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum + gopdum
                   +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


truth.psc <- lm(truther ~ 
                  psc +
                  trustind1 +
                  inteff +
                  exteffic +
                  RWA + ednumeric +
                  theolscale + female + black +
                  hispanic + libdum + consdum + demdum + gopdum +
                  polintnum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

truth.trust <- lm(truther ~ 
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum + psc +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



truth.inteff <- lm(truther ~ 
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum + gopdum +
                     polintnum + psc +trustind1+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



truth.exteff <- lm(truther ~ 
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum + gopdum +
                     polintnum + psc +trustind1 + inteff+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


truth.RWA <- lm(truther ~ 
                  RWA + ednumeric +
                  theolscale + female + black +
                  hispanic + libdum + consdum + demdum + gopdum +
                  polintnum + psc +trustind1 + inteff + exteffic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



# this is what models Iraq War 

iraq.ed <- lm(iraqjews.1 ~ 
                ednumeric + female + black +hispanic +
                libdum + consdum +
                demdum + gopdum +
                polintnum + psc +
                trustind1 +
                inteff +
                exteffic +
                RWA +
                theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

iraq.fem <- lm(iraqjews.1 ~ 
                 female + black +hispanic +
                 libdum + consdum +
                 demdum + gopdum +
                 polintnum + psc +
                 trustind1 +
                 inteff +
                 exteffic +
                 RWA + ednumeric +
                 theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


iraq.black <- lm(iraqjews.1 ~ 
                   black +hispanic +
                   libdum + consdum +
                   demdum + gopdum +
                   polintnum + psc +
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

iraq.hispanic <- lm(iraqjews.1 ~ 
                      hispanic +
                      libdum + consdum +
                      demdum + gopdum +
                      polintnum + psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale + female + black+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

iraq.libdum <- lm(iraqjews.1 ~ 
                    libdum + consdum +
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


iraq.consdum <- lm(iraqjews.1 ~ 
                     consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

iraq.demdum <- lm(iraqjews.1 ~ 
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



iraq.gopdum <- lm(iraqjews.1 ~ 
                    gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


iraq.polint <- lm(iraqjews.1 ~ 
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum
                  +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


iraq.psc <- lm(iraqjews.1 ~ 
                 psc +
                 trustind1 +
                 inteff +
                 exteffic +
                 RWA + ednumeric +
                 theolscale + female + black +
                 hispanic + libdum + consdum + demdum + gopdum +
                 polintnum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

iraq.trust <- lm(iraqjews.1 ~ 
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic + libdum + consdum + demdum + gopdum +
                   polintnum + psc +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



iraq.inteff <- lm(iraqjews.1 ~ 
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum + psc +trustind1+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



iraq.exteff <- lm(iraqjews.1 ~ 
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum + psc +trustind1 + inteff+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


iraq.RWA <- lm(iraqjews.1 ~ 
                 RWA + ednumeric +
                 theolscale + female + black +
                 hispanic + libdum + consdum + demdum + gopdum +
                 polintnum + psc +trustind1 + inteff + exteffic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)




# this is what models Fin. Crisis 

fincrisis.ed <- lm(fincrisis.1 ~ 
                     ednumeric + female + black +hispanic +
                     libdum + consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA +
                     theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

fincrisis.fem <- lm(fincrisis.1 ~ 
                      female + black +hispanic +
                      libdum + consdum +
                      demdum + gopdum +
                      polintnum + psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


fincrisis.black <- lm(fincrisis.1 ~ 
                        black +hispanic +
                        libdum + consdum +
                        demdum + gopdum +
                        polintnum + psc +
                        trustind1 +
                        inteff +
                        exteffic +
                        RWA + ednumeric +
                        theolscale + female+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

fincrisis.hispanic <- lm(fincrisis.1 ~ 
                           hispanic +
                           libdum + consdum +
                           demdum + gopdum +
                           polintnum + psc +
                           trustind1 +
                           inteff +
                           exteffic +
                           RWA + ednumeric +
                           theolscale + female + black+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

fincrisis.libdum <- lm(fincrisis.1 ~ 
                         libdum + consdum +
                         demdum + gopdum +
                         polintnum + psc +
                         trustind1 +
                         inteff +
                         exteffic +
                         RWA + ednumeric +
                         theolscale + female + black +
                         hispanic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


fincrisis.consdum <- lm(fincrisis.1 ~ 
                          consdum +
                          demdum + gopdum +
                          polintnum + psc +
                          trustind1 +
                          inteff +
                          exteffic +
                          RWA + ednumeric +
                          theolscale + female + black +
                          hispanic + libdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

fincrisis.demdum <- lm(fincrisis.1 ~ 
                         demdum + gopdum +
                         polintnum + psc +
                         trustind1 +
                         inteff +
                         exteffic +
                         RWA + ednumeric +
                         theolscale + female + black +
                         hispanic + libdum + consdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



fincrisis.gopdum <- lm(fincrisis.1 ~ 
                         gopdum +
                         polintnum + psc +
                         trustind1 +
                         inteff +
                         exteffic +
                         RWA + ednumeric +
                         theolscale + female + black +
                         hispanic + libdum + consdum + demdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


fincrisis.polint <- lm(fincrisis.1 ~ 
                         polintnum + psc +
                         trustind1 +
                         inteff +
                         exteffic +
                         RWA + ednumeric +
                         theolscale + female + black +
                         hispanic + libdum + consdum + demdum + gopdum
                       +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


fincrisis.psc <- lm(fincrisis.1 ~ 
                      psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale + female + black +
                      hispanic + libdum + consdum + demdum + gopdum +
                      polintnum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

fincrisis.trust <- lm(fincrisis.1 ~ 
                        trustind1 +
                        inteff +
                        exteffic +
                        RWA + ednumeric +
                        theolscale + female + black +
                        hispanic + libdum + consdum + demdum + gopdum +
                        polintnum + psc +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



fincrisis.inteff <- lm(fincrisis.1 ~ 
                         inteff +
                         exteffic +
                         RWA + ednumeric +
                         theolscale + female + black +
                         hispanic + libdum + consdum + demdum + gopdum +
                         polintnum + psc +trustind1+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



fincrisis.exteff <- lm(fincrisis.1 ~ 
                         exteffic +
                         RWA + ednumeric +
                         theolscale + female + black +
                         hispanic + libdum + consdum + demdum + gopdum +
                         polintnum + psc +trustind1 + inteff+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


fincrisis.RWA <- lm(fincrisis.1 ~ 
                      RWA + ednumeric +
                      theolscale + female + black +
                      hispanic + libdum + consdum + demdum + gopdum +
                      polintnum + psc +trustind1 + inteff + exteffic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


# this is what models CFLB 

cflb.ed <- lm(fluorolights ~ 
                ednumeric + female + black +hispanic +
                libdum + consdum +
                demdum + gopdum +
                polintnum + psc +
                trustind1 +
                inteff +
                exteffic +
                RWA +
                theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

cflb.fem <- lm(fluorolights ~ 
                 female + black +hispanic +
                 libdum + consdum +
                 demdum + gopdum +
                 polintnum + psc +
                 trustind1 +
                 inteff +
                 exteffic +
                 RWA + ednumeric +
                 theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


cflb.black <- lm(fluorolights ~ 
                   black +hispanic +
                   libdum + consdum +
                   demdum + gopdum +
                   polintnum + psc +
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

cflb.hispanic <- lm(fluorolights ~ 
                      hispanic +
                      libdum + consdum +
                      demdum + gopdum +
                      polintnum + psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale + female + black+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

cflb.libdum <- lm(fluorolights ~ 
                    libdum + consdum +
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


cflb.consdum <- lm(fluorolights ~ 
                     consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

cflb.demdum <- lm(fluorolights ~ 
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



cflb.gopdum <- lm(fluorolights ~ 
                    gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


cflb.polint <- lm(fluorolights ~ 
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum
                  +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


cflb.psc <- lm(fluorolights ~ 
                 psc +
                 trustind1 +
                 inteff +
                 exteffic +
                 RWA + ednumeric +
                 theolscale + female + black +
                 hispanic + libdum + consdum + demdum + gopdum +
                 polintnum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

cflb.trust <- lm(fluorolights ~ 
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA + ednumeric +
                   theolscale + female + black +
                   hispanic + libdum + consdum + demdum + gopdum +
                   polintnum + psc +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



cflb.inteff <- lm(fluorolights ~ 
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum + psc +trustind1+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



cflb.exteff <- lm(fluorolights ~ 
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum + psc +trustind1 + inteff+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


cflb.RWA <- lm(fluorolights ~ 
                 RWA + ednumeric +
                 theolscale + female + black +
                 hispanic + libdum + consdum + demdum + gopdum +
                 polintnum + psc +trustind1 + inteff + exteffic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


# this is what models Soros 

soros.ed <- lm(soros ~ 
                 ednumeric + female + black +hispanic +
                 libdum + consdum +
                 demdum + gopdum +
                 polintnum + psc +
                 trustind1 +
                 inteff +
                 exteffic +
                 RWA +
                 theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

soros.fem <- lm(soros ~ 
                  female + black +hispanic +
                  libdum + consdum +
                  demdum + gopdum +
                  polintnum + psc +
                  trustind1 +
                  inteff +
                  exteffic +
                  RWA + ednumeric +
                  theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


soros.black <- lm(soros ~ 
                    black +hispanic +
                    libdum + consdum +
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

soros.hispanic <- lm(soros ~ 
                       hispanic +
                       libdum + consdum +
                       demdum + gopdum +
                       polintnum + psc +
                       trustind1 +
                       inteff +
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

soros.libdum <- lm(soros ~ 
                     libdum + consdum +
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


soros.consdum <- lm(soros ~ 
                      consdum +
                      demdum + gopdum +
                      polintnum + psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale + female + black +
                      hispanic + libdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

soros.demdum <- lm(soros ~ 
                     demdum + gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



soros.gopdum <- lm(soros ~ 
                     gopdum +
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


soros.polint <- lm(soros ~ 
                     polintnum + psc +
                     trustind1 +
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum + gopdum
                   +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


soros.psc <- lm(soros ~ 
                  psc +
                  trustind1 +
                  inteff +
                  exteffic +
                  RWA + ednumeric +
                  theolscale + female + black +
                  hispanic + libdum + consdum + demdum + gopdum +
                  polintnum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

soros.trust <- lm(soros ~ 
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum + psc +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



soros.inteff <- lm(soros ~ 
                     inteff +
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum + gopdum +
                     polintnum + psc +trustind1+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



soros.exteff <- lm(soros ~ 
                     exteffic +
                     RWA + ednumeric +
                     theolscale + female + black +
                     hispanic + libdum + consdum + demdum + gopdum +
                     polintnum + psc +trustind1 + inteff+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


soros.RWA <- lm(soros ~ 
                  RWA + ednumeric +
                  theolscale + female + black +
                  hispanic + libdum + consdum + demdum + gopdum +
                  polintnum + psc +trustind1 + inteff + exteffic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



# this is what models Birther 


birther.ed <- lm(birther ~ 
                   ednumeric + female + black +hispanic +
                   libdum + consdum +
                   demdum + gopdum +
                   polintnum + psc +
                   trustind1 +
                   inteff +
                   exteffic +
                   RWA +
                   theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

birther.fem <- lm(birther ~ 
                    female + black +hispanic +
                    libdum + consdum +
                    demdum + gopdum +
                    polintnum + psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


birther.black <- lm(birther ~ 
                      black +hispanic +
                      libdum + consdum +
                      demdum + gopdum +
                      polintnum + psc +
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale + female+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

birther.hispanic <- lm(birther ~ 
                         hispanic +
                         libdum + consdum +
                         demdum + gopdum +
                         polintnum + psc +
                         trustind1 +
                         inteff +
                         exteffic +
                         RWA + ednumeric +
                         theolscale + female + black+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

birther.libdum <- lm(birther ~ 
                       libdum + consdum +
                       demdum + gopdum +
                       polintnum + psc +
                       trustind1 +
                       inteff +
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black +
                       hispanic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


birther.consdum <- lm(birther ~ 
                        consdum +
                        demdum + gopdum +
                        polintnum + psc +
                        trustind1 +
                        inteff +
                        exteffic +
                        RWA + ednumeric +
                        theolscale + female + black +
                        hispanic + libdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

birther.demdum <- lm(birther ~ 
                       demdum + gopdum +
                       polintnum + psc +
                       trustind1 +
                       inteff +
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black +
                       hispanic + libdum + consdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



birther.gopdum <- lm(birther ~ 
                       gopdum +
                       polintnum + psc +
                       trustind1 +
                       inteff +
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black +
                       hispanic + libdum + consdum + demdum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


birther.polint <- lm(birther ~ 
                       polintnum + psc +
                       trustind1 +
                       inteff +
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black +
                       hispanic + libdum + consdum + demdum + gopdum
                     +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


birther.psc <- lm(birther ~ 
                    psc +
                    trustind1 +
                    inteff +
                    exteffic +
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

birther.trust <- lm(birther ~ 
                      trustind1 +
                      inteff +
                      exteffic +
                      RWA + ednumeric +
                      theolscale + female + black +
                      hispanic + libdum + consdum + demdum + gopdum +
                      polintnum + psc +  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



birther.inteff <- lm(birther ~ 
                       inteff +
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black +
                       hispanic + libdum + consdum + demdum + gopdum +
                       polintnum + psc +trustind1+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)



birther.exteff <- lm(birther ~ 
                       exteffic +
                       RWA + ednumeric +
                       theolscale + female + black +
                       hispanic + libdum + consdum + demdum + gopdum +
                       polintnum + psc +trustind1 + inteff+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)


birther.RWA <- lm(birther ~ 
                    RWA + ednumeric +
                    theolscale + female + black +
                    hispanic + libdum + consdum + demdum + gopdum +
                    polintnum + psc +trustind1 + inteff + exteffic+  goodevil + endtimes2 + supernat + cabal + paranormscale, data = fig3)

vap.list <-   list(list(manichean.med, vap.ed, "ednumeric", "goodevil"),
                   list(manichean.med, vap.fem, "female", "goodevil"),
                   list(manichean.med, vap.black, "black", "goodevil"),
                   list(manichean.med, vap.hispanic, "hispanic", "goodevil"),
                   list(manichean.med, vap.libdum, "libdum", "goodevil"),
                   list(manichean.med, vap.consdum, "consdum", "goodevil"),
                   list(manichean.med, vap.demdum, "demdum", "goodevil"),
                   list(manichean.med, vap.gopdum, "gopdum", "goodevil"),
                   list(manichean.med, vap.polint, "polintnum", "goodevil"),
                   list(manichean.med, vap.psc, "psc", "goodevil"),
                   list(manichean.med, vap.trust, "trustind1", "goodevil"),
                   list(manichean.med, vap.inteff, "inteff", "goodevil"),
                   list(manichean.med, vap.exteff, "exteffic", "goodevil"),
                   list(manichean.med, vap.RWA, "RWA", "goodevil"), 
                   list(endtimes.med, vap.ed, "ednumeric", "endtimes2"),
                   list(endtimes.med, vap.fem, "female", "endtimes2"),
                   list(endtimes.med, vap.black, "black", "endtimes2"),
                   list(endtimes.med, vap.hispanic, "hispanic", "endtimes2"),
                   list(endtimes.med, vap.libdum, "libdum", "endtimes2"),
                   list(endtimes.med, vap.consdum, "consdum", "endtimes2"),
                   list(endtimes.med, vap.demdum, "demdum", "endtimes2"),
                   list(endtimes.med, vap.gopdum, "gopdum", "endtimes2"),
                   list(endtimes.med, vap.polint, "polintnum", "endtimes2"),
                   list(endtimes.med, vap.psc, "psc", "endtimes2"),
                   list(endtimes.med, vap.trust, "trustind1", "endtimes2"),
                   list(endtimes.med, vap.inteff, "inteff", "endtimes2"),
                   list(endtimes.med, vap.exteff, "exteffic", "endtimes2"),
                   list(endtimes.med, vap.RWA, "RWA", "endtimes2"),
                   list(supernat.med, vap.ed, "ednumeric", "supernat"),
                   list(supernat.med, vap.fem, "female", "supernat"),
                   list(supernat.med, vap.black, "black", "supernat"),
                   list(supernat.med, vap.hispanic, "hispanic", "supernat"),
                   list(supernat.med, vap.libdum, "libdum", "supernat"),
                   list(supernat.med, vap.consdum, "consdum", "supernat"),
                   list(supernat.med, vap.demdum, "demdum", "supernat"),
                   list(supernat.med, vap.gopdum, "gopdum", "supernat"),
                   list(supernat.med, vap.polint, "polintnum", "supernat"),
                   list(supernat.med, vap.psc, "psc", "supernat"),
                   list(supernat.med, vap.trust, "trustind1", "supernat"),
                   list(supernat.med, vap.inteff, "inteff", "supernat"),
                   list(supernat.med, vap.exteff, "exteffic", "supernat"),
                   list(supernat.med, vap.RWA, "RWA", "supernat"),
                   list(cabal.med, vap.ed, "ednumeric", "cabal"),
                   list(cabal.med, vap.fem, "female", "cabal"),
                   list(cabal.med, vap.black, "black", "cabal"),
                   list(cabal.med, vap.hispanic, "hispanic", "cabal"),
                   list(cabal.med, vap.libdum, "libdum", "cabal"),
                   list(cabal.med, vap.consdum, "consdum", "cabal"),
                   list(cabal.med, vap.demdum, "demdum", "cabal"),
                   list(cabal.med, vap.gopdum, "gopdum", "cabal"),
                   list(cabal.med, vap.polint, "polintnum", "cabal"),
                   list(cabal.med, vap.psc, "psc", "cabal"),
                   list(cabal.med, vap.trust, "trustind1", "cabal"),
                   list(cabal.med, vap.inteff, "inteff", "cabal"),
                   list(cabal.med, vap.exteff, "exteffic", "cabal"),
                   list(cabal.med, vap.RWA, "RWA", "cabal"),
                   list(cabal.med, vap.ed, "ednumeric", "cabal"),
                   list(paranorm.med, vap.fem, "female", "paranormscale"),
                   list(paranorm.med, vap.black, "black", "paranorm"),
                   list(paranorm.med, vap.hispanic, "hispanic", "paranorm"),
                   list(paranorm.med, vap.libdum, "libdum", "parnorm"),
                   list(paranorm.med, vap.consdum, "consdum", "paranorm"),
                   list(paranorm.med, vap.demdum, "demdum", "paranorm"),
                   list(paranorm.med, vap.gopdum, "gopdum", "paranorm"),
                   list(paranorm.med, vap.polint, "polintnum", "paranorm"),
                   list(paranorm.med, vap.psc, "psc", "paranorm"),
                   list(paranorm.med, vap.trust, "trustind1", "paranorm"),
                   list(paranorm.med, vap.inteff, "inteff", "paranorm"),
                   list(paranorm.med, vap.exteff, "exteffic", "paranorm"),
                   list(paranorm.med, vap.RWA, "RWA", "paranorm"))

vap.list2 <-   list(list(manichean.med, vap.ed, "ednumeric", "goodevil"),
                    list(manichean.med, vap.fem, "female", "goodevil"),
                    list(manichean.med, vap.black, "black", "goodevil"),
                    list(manichean.med, vap.hispanic, "hispanic", "goodevil"),
                    list(manichean.med, vap.libdum, "libdum", "goodevil"),
                    list(manichean.med, vap.consdum, "consdum", "goodevil"),
                    list(manichean.med, vap.demdum, "demdum", "goodevil"),
                    list(manichean.med, vap.gopdum, "gopdum", "goodevil"),
                    list(manichean.med, vap.polint, "polintnum", "goodevil"),
                    list(manichean.med, vap.psc, "psc", "goodevil"),
                    list(manichean.med, vap.trust, "trustind1", "goodevil"),
                    list(manichean.med, vap.inteff, "inteff", "goodevil"),
                    list(manichean.med, vap.exteff, "exteffic", "goodevil"),
                    list(manichean.med, vap.RWA, "RWA", "goodevil"), 
                    list(endtimes.med, vap.ed, "ednumeric", "endtimes2"),
                    list(endtimes.med, vap.fem, "female", "endtimes2"),
                    list(endtimes.med, vap.black, "black", "endtimes2"),
                    list(endtimes.med, vap.hispanic, "hispanic", "endtimes2"),
                    list(endtimes.med, vap.libdum, "libdum", "endtimes2"),
                    list(endtimes.med, vap.consdum, "consdum", "endtimes2"),
                    list(endtimes.med, vap.demdum, "demdum", "endtimes2"),
                    list(endtimes.med, vap.gopdum, "gopdum", "endtimes2"),
                    list(endtimes.med, vap.polint, "polintnum", "endtimes2"),
                    list(endtimes.med, vap.psc, "psc", "endtimes2"),
                    list(endtimes.med, vap.trust, "trustind1", "endtimes2"),
                    list(endtimes.med, vap.inteff, "inteff", "endtimes2"),
                    list(endtimes.med, vap.exteff, "exteffic", "endtimes2"),
                    list(endtimes.med, vap.RWA, "RWA", "endtimes2"),
                    list(supernat.med, vap.ed, "ednumeric", "supernat"),
                    list(supernat.med, vap.fem, "female", "supernat"),
                    list(supernat.med, vap.black, "black", "supernat"),
                    list(supernat.med, vap.hispanic, "hispanic", "supernat"),
                    list(supernat.med, vap.libdum, "libdum", "supernat"),
                    list(supernat.med, vap.consdum, "consdum", "supernat"),
                    list(supernat.med, vap.demdum, "demdum", "supernat"),
                    list(supernat.med, vap.gopdum, "gopdum", "supernat"),
                    list(supernat.med, vap.polint, "polintnum", "supernat"),
                    list(supernat.med, vap.psc, "psc", "supernat"),
                    list(supernat.med, vap.trust, "trustind1", "supernat"),
                    list(supernat.med, vap.inteff, "inteff", "supernat"),
                    list(supernat.med, vap.exteff, "exteffic", "supernat"),
                    list(supernat.med, vap.RWA, "RWA", "supernat"),
                    list(cabal.med, vap.ed, "ednumeric", "cabal"),
                    list(cabal.med, vap.fem, "female", "cabal"),
                    list(cabal.med, vap.black, "black", "cabal", "cabal"),
                    list(cabal.med, vap.hispanic, "hispanic", "cabal"),
                    list(cabal.med, vap.libdum, "libdum", "cabal"),
                    list(cabal.med, vap.consdum, "consdum", "cabal"),
                    list(cabal.med, vap.demdum, "demdum", "cabal"),
                    list(cabal.med, vap.gopdum, "gopdum", "cabal"),
                    list(cabal.med, vap.polint, "polintnum", "cabal"),
                    list(cabal.med, vap.psc, "psc", "cabal"),
                    list(cabal.med, vap.trust, "trustind1", "cabal"),
                    list(cabal.med, vap.inteff, "inteff", "cabal"),
                    list(cabal.med, vap.exteff, "exteffic", "cabal"),
                    list(cabal.med, vap.RWA, "RWA", "cabal"),
                    list(cabal.med, vap.ed, "ednumeric", "cabal"),
                    list(paranorm.med, vap.fem, "female", "theolscale"),
                    list(paranorm.med, vap.black, "black", "theolscale"),
                    list(paranorm.med, vap.hispanic, "hispanic", "theolscale"),
                    list(paranorm.med, vap.libdum, "libdum", "theolscale"),
                    list(paranorm.med, vap.consdum, "consdum", "theolscale"),
                    list(paranorm.med, vap.demdum, "demdum", "theolscale"),
                    list(paranorm.med, vap.gopdum, "gopdum", "theolscale"),
                    list(paranorm.med, vap.polint, "polintnum", "theolscale"),
                    list(paranorm.med, vap.psc, "psc", "theolscale"),
                    list(paranorm.med, vap.trust, "trustind1", "theolscale"),
                    list(paranorm.med, vap.inteff, "inteff", "theolscale"),
                    list(paranorm.med, vap.exteff, "exteffic", "theolscale"),
                    list(paranorm.med, vap.RWA, "RWA", "theolscale"))




truth.list2 <-   list(list(manichean.med, truth.ed, "ednumeric", "endtimes2"),
                      list(manichean.med, truth.fem, "female", "endtimes2"),
                      list(manichean.med, truth.black, "black", "endtimes2"),
                      list(manichean.med, truth.hispanic, "hispanic", "endtimes2"),
                      list(manichean.med, truth.libdum, "libdum", "endtimes2"),
                      list(manichean.med, truth.consdum, "consdum", "endtimes2"),
                      list(manichean.med, truth.demdum, "demdum", "endtimes2"),
                      list(manichean.med, truth.gopdum, "gopdum", "endtimes2"),
                      list(manichean.med, truth.polint, "polintnum", "endtimes2"),
                      list(manichean.med, truth.psc, "psc", "endtimes2"),
                      list(manichean.med, truth.trust, "trustind1", "endtimes2"),
                      list(manichean.med, truth.inteff, "inteff", "endtimes2"),
                      list(manichean.med, truth.exteff, "exteffic", "endtimes2"),
                      list(manichean.med, truth.RWA, "RWA", "endtimes2"), 
                      list(endtimes.med, truth.ed, "ednumeric", "cabal"),
                      list(endtimes.med, truth.fem, "female", "cabal"),
                      list(endtimes.med, truth.black, "black", "cabal"),
                      list(endtimes.med, truth.hispanic, "hispanic", "cabal"),
                      list(endtimes.med, truth.libdum, "libdum", "cabal"),
                      list(endtimes.med, truth.consdum, "consdum", "cabal"),
                      list(endtimes.med, truth.demdum, "demdum", "cabal"),
                      list(endtimes.med, truth.gopdum, "gopdum", "cabal"),
                      list(endtimes.med, truth.polint, "polintnum", "cabal"),
                      list(endtimes.med, truth.psc, "psc", "cabal"),
                      list(endtimes.med, truth.trust, "trustind1", "cabal"),
                      list(endtimes.med, truth.inteff, "inteff", "cabal"),
                      list(endtimes.med, truth.exteff, "exteffic", "cabal"),
                      list(endtimes.med, truth.RWA, "RWA", "cabal"),
                      list(supernat.med, truth.ed, "ednumeric", "goodevil"),
                      list(supernat.med, truth.fem, "female", "goodevil"),
                      list(supernat.med, truth.black, "black", "goodevil"),
                      list(supernat.med, truth.hispanic, "hispanic", "goodevil"),
                      list(supernat.med, truth.libdum, "libdum", "goodevil"),
                      list(supernat.med, truth.consdum, "consdum", "goodevil"),
                      list(supernat.med, truth.demdum, "demdum", "goodevil"),
                      list(supernat.med, truth.gopdum, "gopdum", "goodevil"),
                      list(supernat.med, truth.polint, "polintnum", "goodevil"),
                      list(supernat.med, truth.psc, "psc", "goodevil"),
                      list(supernat.med, truth.trust, "trustind1", "goodevil"),
                      list(supernat.med, truth.inteff, "inteff", "goodevil"),
                      list(supernat.med, truth.exteff, "exteffic", "goodevil"),
                      list(supernat.med, truth.RWA, "RWA", "goodevil"),
                      list(cabal.med, truth.ed, "ednumeric", "supernat"),
                      list(cabal.med, truth.fem, "female", "supernat"),
                      list(cabal.med, truth.black, "black", "supernat", "supernat"),
                      list(cabal.med, truth.hispanic, "hispanic", "supernat"),
                      list(cabal.med, truth.libdum, "libdum", "supernat"),
                      list(cabal.med, truth.consdum, "consdum", "supernat"),
                      list(cabal.med, truth.demdum, "demdum", "supernat"),
                      list(cabal.med, truth.gopdum, "gopdum", "supernat"),
                      list(cabal.med, truth.polint, "polintnum", "supernat"),
                      list(cabal.med, truth.psc, "psc", "supernat"),
                      list(cabal.med, truth.trust, "trustind1", "supernat"),
                      list(cabal.med, truth.inteff, "inteff", "supernat"),
                      list(cabal.med, truth.exteff, "exteffic", "supernat"),
                      list(cabal.med, truth.RWA, "RWA", "theolscale"),
                      list(cabal.med, truth.ed, "ednumeric", "theolscale"),
                      list(paranorm.med, truth.fem, "female", "theolscale"),
                      list(paranorm.med, truth.black, "black", "theolscale"),
                      list(paranorm.med, truth.hispanic, "hispanic", "theolscale"),
                      list(paranorm.med, truth.libdum, "libdum", "theolscale"),
                      list(paranorm.med, truth.consdum, "consdum", "theolscale"),
                      list(paranorm.med, truth.demdum, "demdum", "theolscale"),
                      list(paranorm.med, truth.gopdum, "gopdum", "theolscale"),
                      list(paranorm.med, truth.polint, "polintnum", "theolscale"),
                      list(paranorm.med, truth.psc, "psc", "theolscale"),
                      list(paranorm.med, truth.trust, "trustind1", "theolscale"),
                      list(paranorm.med, truth.inteff, "inteff", "theolscale"),
                      list(paranorm.med, truth.exteff, "exteffic", "theolscale"),
                      list(paranorm.med, truth.RWA, "RWA", "theolscale"))




iraq.list2 <-   list(list(manichean.med,  iraq.ed, "ednumeric", "endtimes2"),
                     list(manichean.med, iraq.fem, "female", "endtimes2"),
                     list(manichean.med, iraq.black, "black", "endtimes2"),
                     list(manichean.med, iraq.hispanic, "hispanic", "endtimes2"),
                     list(manichean.med, iraq.libdum, "libdum", "endtimes2"),
                     list(manichean.med, iraq.consdum, "consdum", "endtimes2"),
                     list(manichean.med, iraq.demdum, "demdum", "endtimes2"),
                     list(manichean.med, iraq.gopdum, "gopdum", "endtimes2"),
                     list(manichean.med, iraq.polint, "polintnum", "endtimes2"),
                     list(manichean.med, iraq.psc, "psc", "endtimes2"),
                     list(manichean.med, iraq.trust, "trustind1", "endtimes2"),
                     list(manichean.med, iraq.inteff, "inteff", "endtimes2"),
                     list(manichean.med, iraq.exteff, "exteffic", "endtimes2"),
                     list(manichean.med, iraq.RWA, "RWA", "endtimes2"), 
                     list(endtimes.med, iraq.ed, "ednumeric", "cabal"),
                     list(endtimes.med, iraq.fem, "female", "cabal"),
                     list(endtimes.med, iraq.black, "black", "cabal"),
                     list(endtimes.med, iraq.hispanic, "hispanic", "cabal"),
                     list(endtimes.med, iraq.libdum, "libdum", "cabal"),
                     list(endtimes.med, iraq.consdum, "consdum", "cabal"),
                     list(endtimes.med, iraq.demdum, "demdum", "cabal"),
                     list(endtimes.med, iraq.gopdum, "gopdum", "cabal"),
                     list(endtimes.med, iraq.polint, "polintnum", "cabal"),
                     list(endtimes.med, iraq.psc, "psc", "cabal"),
                     list(endtimes.med, iraq.trust, "trustind1", "cabal"),
                     list(endtimes.med, iraq.inteff, "inteff", "cabal"),
                     list(endtimes.med, iraq.exteff, "exteffic", "cabal"),
                     list(endtimes.med, iraq.RWA, "RWA", "cabal"),
                     list(supernat.med, iraq.ed, "ednumeric", "goodevil"),
                     list(supernat.med, iraq.fem, "female", "goodevil"),
                     list(supernat.med, iraq.black, "black", "goodevil"),
                     list(supernat.med, iraq.hispanic, "hispanic", "goodevil"),
                     list(supernat.med, iraq.libdum, "libdum", "goodevil"),
                     list(supernat.med, iraq.consdum, "consdum", "goodevil"),
                     list(supernat.med, iraq.demdum, "demdum", "goodevil"),
                     list(supernat.med, iraq.gopdum, "gopdum", "goodevil"),
                     list(supernat.med, iraq.polint, "polintnum", "goodevil"),
                     list(supernat.med, iraq.psc, "psc", "goodevil"),
                     list(supernat.med, iraq.trust, "trustind1", "goodevil"),
                     list(supernat.med, iraq.inteff, "inteff", "goodevil"),
                     list(supernat.med, iraq.exteff, "exteffic", "goodevil"),
                     list(supernat.med, iraq.RWA, "RWA", "goodevil"),
                     list(cabal.med, iraq.ed, "ednumeric", "supernat"),
                     list(cabal.med, iraq.fem, "female", "supernat"),
                     list(cabal.med, iraq.black, "black", "supernat", "supernat"),
                     list(cabal.med, iraq.hispanic, "hispanic", "supernat"),
                     list(cabal.med, iraq.libdum, "libdum", "supernat"),
                     list(cabal.med, iraq.consdum, "consdum", "supernat"),
                     list(cabal.med, iraq.demdum, "demdum", "supernat"),
                     list(cabal.med, iraq.gopdum, "gopdum", "supernat"),
                     list(cabal.med, iraq.polint, "polintnum", "supernat"),
                     list(cabal.med, iraq.psc, "psc", "supernat"),
                     list(cabal.med, iraq.trust, "trustind1", "supernat"),
                     list(cabal.med, iraq.inteff, "inteff", "supernat"),
                     list(cabal.med, iraq.exteff, "exteffic", "supernat"),
                     list(cabal.med, iraq.RWA, "RWA", "theolscale"),
                     list(cabal.med, iraq.ed, "ednumeric", "theolscale"),
                     list(paranorm.med, iraq.fem, "female", "theolscale"),
                     list(paranorm.med, iraq.black, "black", "theolscale"),
                     list(paranorm.med, iraq.hispanic, "hispanic", "theolscale"),
                     list(paranorm.med, iraq.libdum, "libdum", "theolscale"),
                     list(paranorm.med, iraq.consdum, "consdum", "theolscale"),
                     list(paranorm.med, iraq.demdum, "demdum", "theolscale"),
                     list(paranorm.med, iraq.gopdum, "gopdum", "theolscale"),
                     list(paranorm.med, iraq.polint, "polintnum", "theolscale"),
                     list(paranorm.med, iraq.psc, "psc", "theolscale"),
                     list(paranorm.med, iraq.trust, "trustind1", "theolscale"),
                     list(paranorm.med, iraq.inteff, "inteff", "theolscale"),
                     list(paranorm.med, iraq.exteff, "exteffic", "theolscale"),
                     list(paranorm.med, iraq.RWA, "RWA", "theolscale"))


fincrisis.list2 <-   list(list(manichean.med,  fincrisis.ed, "ednumeric", "endtimes2"),
                          list(manichean.med, fincrisis.fem, "female", "endtimes2"),
                          list(manichean.med, fincrisis.black, "black", "endtimes2"),
                          list(manichean.med, fincrisis.hispanic, "hispanic", "endtimes2"),
                          list(manichean.med, fincrisis.libdum, "libdum", "endtimes2"),
                          list(manichean.med, fincrisis.consdum, "consdum", "endtimes2"),
                          list(manichean.med, fincrisis.demdum, "demdum", "endtimes2"),
                          list(manichean.med, fincrisis.gopdum, "gopdum", "endtimes2"),
                          list(manichean.med, fincrisis.polint, "polintnum", "endtimes2"),
                          list(manichean.med, fincrisis.psc, "psc", "endtimes2"),
                          list(manichean.med, fincrisis.trust, "trustind1", "endtimes2"),
                          list(manichean.med, fincrisis.inteff, "inteff", "endtimes2"),
                          list(manichean.med, fincrisis.exteff, "exteffic", "endtimes2"),
                          list(manichean.med, fincrisis.RWA, "RWA", "endtimes2"), 
                          list(endtimes.med, fincrisis.ed, "ednumeric", "cabal"),
                          list(endtimes.med, fincrisis.fem, "female", "cabal"),
                          list(endtimes.med, fincrisis.black, "black", "cabal"),
                          list(endtimes.med, fincrisis.hispanic, "hispanic", "cabal"),
                          list(endtimes.med, fincrisis.libdum, "libdum", "cabal"),
                          list(endtimes.med, fincrisis.consdum, "consdum", "cabal"),
                          list(endtimes.med, fincrisis.demdum, "demdum", "cabal"),
                          list(endtimes.med, fincrisis.gopdum, "gopdum", "cabal"),
                          list(endtimes.med, fincrisis.polint, "polintnum", "cabal"),
                          list(endtimes.med, fincrisis.psc, "psc", "cabal"),
                          list(endtimes.med, fincrisis.trust, "trustind1", "cabal"),
                          list(endtimes.med, fincrisis.inteff, "inteff", "cabal"),
                          list(endtimes.med, fincrisis.exteff, "exteffic", "cabal"),
                          list(endtimes.med, fincrisis.RWA, "RWA", "cabal"),
                          list(supernat.med, fincrisis.ed, "ednumeric", "goodevil"),
                          list(supernat.med, fincrisis.fem, "female", "goodevil"),
                          list(supernat.med, fincrisis.black, "black", "goodevil"),
                          list(supernat.med, fincrisis.hispanic, "hispanic", "goodevil"),
                          list(supernat.med, fincrisis.libdum, "libdum", "goodevil"),
                          list(supernat.med, fincrisis.consdum, "consdum", "goodevil"),
                          list(supernat.med, fincrisis.demdum, "demdum", "goodevil"),
                          list(supernat.med, fincrisis.gopdum, "gopdum", "goodevil"),
                          list(supernat.med, fincrisis.polint, "polintnum", "goodevil"),
                          list(supernat.med, fincrisis.psc, "psc", "goodevil"),
                          list(supernat.med, fincrisis.trust, "trustind1", "goodevil"),
                          list(supernat.med, fincrisis.inteff, "inteff", "goodevil"),
                          list(supernat.med, fincrisis.exteff, "exteffic", "goodevil"),
                          list(supernat.med, fincrisis.RWA, "RWA", "goodevil"),
                          list(cabal.med, fincrisis.ed, "ednumeric", "supernat"),
                          list(cabal.med, fincrisis.fem, "female", "supernat"),
                          list(cabal.med, fincrisis.black, "black", "supernat", "supernat"),
                          list(cabal.med, fincrisis.hispanic, "hispanic", "supernat"),
                          list(cabal.med, fincrisis.libdum, "libdum", "supernat"),
                          list(cabal.med, fincrisis.consdum, "consdum", "supernat"),
                          list(cabal.med, fincrisis.demdum, "demdum", "supernat"),
                          list(cabal.med, fincrisis.gopdum, "gopdum", "supernat"),
                          list(cabal.med, fincrisis.polint, "polintnum", "supernat"),
                          list(cabal.med, fincrisis.psc, "psc", "supernat"),
                          list(cabal.med, fincrisis.trust, "trustind1", "supernat"),
                          list(cabal.med, fincrisis.inteff, "inteff", "supernat"),
                          list(cabal.med, fincrisis.exteff, "exteffic", "supernat"),
                          list(cabal.med, fincrisis.RWA, "RWA", "theolscale"),
                          list(cabal.med, fincrisis.ed, "ednumeric", "theolscale"),
                          list(paranorm.med, fincrisis.fem, "female", "theolscale"),
                          list(paranorm.med, fincrisis.black, "black", "theolscale"),
                          list(paranorm.med, fincrisis.hispanic, "hispanic", "theolscale"),
                          list(paranorm.med, fincrisis.libdum, "libdum", "theolscale"),
                          list(paranorm.med, fincrisis.consdum, "consdum", "theolscale"),
                          list(paranorm.med, fincrisis.demdum, "demdum", "theolscale"),
                          list(paranorm.med, fincrisis.gopdum, "gopdum", "theolscale"),
                          list(paranorm.med, fincrisis.polint, "polintnum", "theolscale"),
                          list(paranorm.med, fincrisis.psc, "psc", "theolscale"),
                          list(paranorm.med, fincrisis.trust, "trustind1", "theolscale"),
                          list(paranorm.med, fincrisis.inteff, "inteff", "theolscale"),
                          list(paranorm.med, fincrisis.exteff, "exteffic", "theolscale"),
                          list(paranorm.med, fincrisis.RWA, "RWA", "theolscale"))



cflb.list2 <-   list(list(manichean.med,  cflb.ed, "ednumeric", "endtimes2"),
                     list(manichean.med, cflb.fem, "female", "endtimes2"),
                     list(manichean.med, cflb.black, "black", "endtimes2"),
                     list(manichean.med, cflb.hispanic, "hispanic", "endtimes2"),
                     list(manichean.med, cflb.libdum, "libdum", "endtimes2"),
                     list(manichean.med, cflb.consdum, "consdum", "endtimes2"),
                     list(manichean.med, cflb.demdum, "demdum", "endtimes2"),
                     list(manichean.med, cflb.gopdum, "gopdum", "endtimes2"),
                     list(manichean.med, cflb.polint, "polintnum", "endtimes2"),
                     list(manichean.med, cflb.psc, "psc", "endtimes2"),
                     list(manichean.med, cflb.trust, "trustind1", "endtimes2"),
                     list(manichean.med, cflb.inteff, "inteff", "endtimes2"),
                     list(manichean.med, cflb.exteff, "exteffic", "endtimes2"),
                     list(manichean.med, cflb.RWA, "RWA", "endtimes2"), 
                     list(endtimes.med, cflb.ed, "ednumeric", "cabal"),
                     list(endtimes.med, cflb.fem, "female", "cabal"),
                     list(endtimes.med, cflb.black, "black", "cabal"),
                     list(endtimes.med, cflb.hispanic, "hispanic", "cabal"),
                     list(endtimes.med, cflb.libdum, "libdum", "cabal"),
                     list(endtimes.med, cflb.consdum, "consdum", "cabal"),
                     list(endtimes.med, cflb.demdum, "demdum", "cabal"),
                     list(endtimes.med, cflb.gopdum, "gopdum", "cabal"),
                     list(endtimes.med, cflb.polint, "polintnum", "cabal"),
                     list(endtimes.med, cflb.psc, "psc", "cabal"),
                     list(endtimes.med, cflb.trust, "trustind1", "cabal"),
                     list(endtimes.med, cflb.inteff, "inteff", "cabal"),
                     list(endtimes.med, cflb.exteff, "exteffic", "cabal"),
                     list(endtimes.med, cflb.RWA, "RWA", "cabal"),
                     list(supernat.med, cflb.ed, "ednumeric", "goodevil"),
                     list(supernat.med, cflb.fem, "female", "goodevil"),
                     list(supernat.med, cflb.black, "black", "goodevil"),
                     list(supernat.med, cflb.hispanic, "hispanic", "goodevil"),
                     list(supernat.med, cflb.libdum, "libdum", "goodevil"),
                     list(supernat.med, cflb.consdum, "consdum", "goodevil"),
                     list(supernat.med, cflb.demdum, "demdum", "goodevil"),
                     list(supernat.med, cflb.gopdum, "gopdum", "goodevil"),
                     list(supernat.med, cflb.polint, "polintnum", "goodevil"),
                     list(supernat.med, cflb.psc, "psc", "goodevil"),
                     list(supernat.med, cflb.trust, "trustind1", "goodevil"),
                     list(supernat.med, cflb.inteff, "inteff", "goodevil"),
                     list(supernat.med, cflb.exteff, "exteffic", "goodevil"),
                     list(supernat.med, cflb.RWA, "RWA", "goodevil"),
                     list(cabal.med, cflb.ed, "ednumeric", "supernat"),
                     list(cabal.med, cflb.fem, "female", "supernat"),
                     list(cabal.med, cflb.black, "black", "supernat", "supernat"),
                     list(cabal.med, cflb.hispanic, "hispanic", "supernat"),
                     list(cabal.med, cflb.libdum, "libdum", "supernat"),
                     list(cabal.med, cflb.consdum, "consdum", "supernat"),
                     list(cabal.med, cflb.demdum, "demdum", "supernat"),
                     list(cabal.med, cflb.gopdum, "gopdum", "supernat"),
                     list(cabal.med, cflb.polint, "polintnum", "supernat"),
                     list(cabal.med, cflb.psc, "psc", "supernat"),
                     list(cabal.med, cflb.trust, "trustind1", "supernat"),
                     list(cabal.med, cflb.inteff, "inteff", "supernat"),
                     list(cabal.med, cflb.exteff, "exteffic", "supernat"),
                     list(cabal.med, cflb.RWA, "RWA", "theolscale"),
                     list(cabal.med, cflb.ed, "ednumeric", "theolscale"),
                     list(paranorm.med, cflb.fem, "female", "theolscale"),
                     list(paranorm.med, cflb.black, "black", "theolscale"),
                     list(paranorm.med, cflb.hispanic, "hispanic", "theolscale"),
                     list(paranorm.med, cflb.libdum, "libdum", "theolscale"),
                     list(paranorm.med, cflb.consdum, "consdum", "theolscale"),
                     list(paranorm.med, cflb.demdum, "demdum", "theolscale"),
                     list(paranorm.med, cflb.gopdum, "gopdum", "theolscale"),
                     list(paranorm.med, cflb.polint, "polintnum", "theolscale"),
                     list(paranorm.med, cflb.psc, "psc", "theolscale"),
                     list(paranorm.med, cflb.trust, "trustind1", "theolscale"),
                     list(paranorm.med, cflb.inteff, "inteff", "theolscale"),
                     list(paranorm.med, cflb.exteff, "exteffic", "theolscale"),
                     list(paranorm.med, cflb.RWA, "RWA", "theolscale"))


soros.list2 <-   list(list(manichean.med,  soros.ed, "ednumeric", "endtimes2"),
                      list(manichean.med, soros.fem, "female", "endtimes2"),
                      list(manichean.med, soros.black, "black", "endtimes2"),
                      list(manichean.med, soros.hispanic, "hispanic", "endtimes2"),
                      list(manichean.med, soros.libdum, "libdum", "endtimes2"),
                      list(manichean.med, soros.consdum, "consdum", "endtimes2"),
                      list(manichean.med, soros.demdum, "demdum", "endtimes2"),
                      list(manichean.med, soros.gopdum, "gopdum", "endtimes2"),
                      list(manichean.med, soros.polint, "polintnum", "endtimes2"),
                      list(manichean.med, soros.psc, "psc", "endtimes2"),
                      list(manichean.med, soros.trust, "trustind1", "endtimes2"),
                      list(manichean.med, soros.inteff, "inteff", "endtimes2"),
                      list(manichean.med, soros.exteff, "exteffic", "endtimes2"),
                      list(manichean.med, soros.RWA, "RWA", "endtimes2"), 
                      list(endtimes.med, soros.ed, "ednumeric", "cabal"),
                      list(endtimes.med, soros.fem, "female", "cabal"),
                      list(endtimes.med, soros.black, "black", "cabal"),
                      list(endtimes.med, soros.hispanic, "hispanic", "cabal"),
                      list(endtimes.med, soros.libdum, "libdum", "cabal"),
                      list(endtimes.med, soros.consdum, "consdum", "cabal"),
                      list(endtimes.med, soros.demdum, "demdum", "cabal"),
                      list(endtimes.med, soros.gopdum, "gopdum", "cabal"),
                      list(endtimes.med, soros.polint, "polintnum", "cabal"),
                      list(endtimes.med, soros.psc, "psc", "cabal"),
                      list(endtimes.med, soros.trust, "trustind1", "cabal"),
                      list(endtimes.med, soros.inteff, "inteff", "cabal"),
                      list(endtimes.med, soros.exteff, "exteffic", "cabal"),
                      list(endtimes.med, soros.RWA, "RWA", "cabal"),
                      list(supernat.med, soros.ed, "ednumeric", "goodevil"),
                      list(supernat.med, soros.fem, "female", "goodevil"),
                      list(supernat.med, soros.black, "black", "goodevil"),
                      list(supernat.med, soros.hispanic, "hispanic", "goodevil"),
                      list(supernat.med, soros.libdum, "libdum", "goodevil"),
                      list(supernat.med, soros.consdum, "consdum", "goodevil"),
                      list(supernat.med, soros.demdum, "demdum", "goodevil"),
                      list(supernat.med, soros.gopdum, "gopdum", "goodevil"),
                      list(supernat.med, soros.polint, "polintnum", "goodevil"),
                      list(supernat.med, soros.psc, "psc", "goodevil"),
                      list(supernat.med, soros.trust, "trustind1", "goodevil"),
                      list(supernat.med, soros.inteff, "inteff", "goodevil"),
                      list(supernat.med, soros.exteff, "exteffic", "goodevil"),
                      list(supernat.med, soros.RWA, "RWA", "goodevil"),
                      list(cabal.med, soros.ed, "ednumeric", "supernat"),
                      list(cabal.med, soros.fem, "female", "supernat"),
                      list(cabal.med, soros.black, "black", "supernat", "supernat"),
                      list(cabal.med, soros.hispanic, "hispanic", "supernat"),
                      list(cabal.med, soros.libdum, "libdum", "supernat"),
                      list(cabal.med, soros.consdum, "consdum", "supernat"),
                      list(cabal.med, soros.demdum, "demdum", "supernat"),
                      list(cabal.med, soros.gopdum, "gopdum", "supernat"),
                      list(cabal.med, soros.polint, "polintnum", "supernat"),
                      list(cabal.med, soros.psc, "psc", "supernat"),
                      list(cabal.med, soros.trust, "trustind1", "supernat"),
                      list(cabal.med, soros.inteff, "inteff", "supernat"),
                      list(cabal.med, soros.exteff, "exteffic", "supernat"),
                      list(cabal.med, soros.RWA, "RWA", "theolscale"),
                      list(cabal.med, soros.ed, "ednumeric", "theolscale"),
                      list(paranorm.med, soros.fem, "female", "theolscale"),
                      list(paranorm.med, soros.black, "black", "theolscale"),
                      list(paranorm.med, soros.hispanic, "hispanic", "theolscale"),
                      list(paranorm.med, soros.libdum, "libdum", "theolscale"),
                      list(paranorm.med, soros.consdum, "consdum", "theolscale"),
                      list(paranorm.med, soros.demdum, "demdum", "theolscale"),
                      list(paranorm.med, soros.gopdum, "gopdum", "theolscale"),
                      list(paranorm.med, soros.polint, "polintnum", "theolscale"),
                      list(paranorm.med, soros.psc, "psc", "theolscale"),
                      list(paranorm.med, soros.trust, "trustind1", "theolscale"),
                      list(paranorm.med, soros.inteff, "inteff", "theolscale"),
                      list(paranorm.med, soros.exteff, "exteffic", "theolscale"),
                      list(paranorm.med, soros.RWA, "RWA", "theolscale"))




birther.list2 <-   list(list(manichean.med,  birther.ed, "ednumeric", "endtimes2"),
                        list(manichean.med, birther.fem, "female", "endtimes2"),
                        list(manichean.med, birther.black, "black", "endtimes2"),
                        list(manichean.med, birther.hispanic, "hispanic", "endtimes2"),
                        list(manichean.med, birther.libdum, "libdum", "endtimes2"),
                        list(manichean.med, birther.consdum, "consdum", "endtimes2"),
                        list(manichean.med, birther.demdum, "demdum", "endtimes2"),
                        list(manichean.med, birther.gopdum, "gopdum", "endtimes2"),
                        list(manichean.med, birther.polint, "polintnum", "endtimes2"),
                        list(manichean.med, birther.psc, "psc", "endtimes2"),
                        list(manichean.med, birther.trust, "trustind1", "endtimes2"),
                        list(manichean.med, birther.inteff, "inteff", "endtimes2"),
                        list(manichean.med, birther.exteff, "exteffic", "endtimes2"),
                        list(manichean.med, birther.RWA, "RWA", "endtimes2"), 
                        list(endtimes.med, birther.ed, "ednumeric", "cabal"),
                        list(endtimes.med, birther.fem, "female", "cabal"),
                        list(endtimes.med, birther.black, "black", "cabal"),
                        list(endtimes.med, birther.hispanic, "hispanic", "cabal"),
                        list(endtimes.med, birther.libdum, "libdum", "cabal"),
                        list(endtimes.med, birther.consdum, "consdum", "cabal"),
                        list(endtimes.med, birther.demdum, "demdum", "cabal"),
                        list(endtimes.med, birther.gopdum, "gopdum", "cabal"),
                        list(endtimes.med, birther.polint, "polintnum", "cabal"),
                        list(endtimes.med, birther.psc, "psc", "cabal"),
                        list(endtimes.med, birther.trust, "trustind1", "cabal"),
                        list(endtimes.med, birther.inteff, "inteff", "cabal"),
                        list(endtimes.med, birther.exteff, "exteffic", "cabal"),
                        list(endtimes.med, birther.RWA, "RWA", "cabal"),
                        list(supernat.med, birther.ed, "ednumeric", "goodevil"),
                        list(supernat.med, birther.fem, "female", "goodevil"),
                        list(supernat.med, birther.black, "black", "goodevil"),
                        list(supernat.med, birther.hispanic, "hispanic", "goodevil"),
                        list(supernat.med, birther.libdum, "libdum", "goodevil"),
                        list(supernat.med, birther.consdum, "consdum", "goodevil"),
                        list(supernat.med, birther.demdum, "demdum", "goodevil"),
                        list(supernat.med, birther.gopdum, "gopdum", "goodevil"),
                        list(supernat.med, birther.polint, "polintnum", "goodevil"),
                        list(supernat.med, birther.psc, "psc", "goodevil"),
                        list(supernat.med, birther.trust, "trustind1", "goodevil"),
                        list(supernat.med, birther.inteff, "inteff", "goodevil"),
                        list(supernat.med, birther.exteff, "exteffic", "goodevil"),
                        list(supernat.med, birther.RWA, "RWA", "goodevil"),
                        list(cabal.med, birther.ed, "ednumeric", "supernat"),
                        list(cabal.med, birther.fem, "female", "supernat"),
                        list(cabal.med, birther.black, "black", "supernat", "supernat"),
                        list(cabal.med, birther.hispanic, "hispanic", "supernat"),
                        list(cabal.med, birther.libdum, "libdum", "supernat"),
                        list(cabal.med, birther.consdum, "consdum", "supernat"),
                        list(cabal.med, birther.demdum, "demdum", "supernat"),
                        list(cabal.med, birther.gopdum, "gopdum", "supernat"),
                        list(cabal.med, birther.polint, "polintnum", "supernat"),
                        list(cabal.med, birther.psc, "psc", "supernat"),
                        list(cabal.med, birther.trust, "trustind1", "supernat"),
                        list(cabal.med, birther.inteff, "inteff", "supernat"),
                        list(cabal.med, birther.exteff, "exteffic", "supernat"),
                        list(cabal.med, birther.RWA, "RWA", "theolscale"),
                        list(cabal.med, birther.ed, "ednumeric", "theolscale"),
                        list(paranorm.med, birther.fem, "female", "theolscale"),
                        list(paranorm.med, birther.black, "black", "theolscale"),
                        list(paranorm.med, birther.hispanic, "hispanic", "theolscale"),
                        list(paranorm.med, birther.libdum, "libdum", "theolscale"),
                        list(paranorm.med, birther.consdum, "consdum", "theolscale"),
                        list(paranorm.med, birther.demdum, "demdum", "theolscale"),
                        list(paranorm.med, birther.gopdum, "gopdum", "theolscale"),
                        list(paranorm.med, birther.polint, "polintnum", "theolscale"),
                        list(paranorm.med, birther.psc, "psc", "theolscale"),
                        list(paranorm.med, birther.trust, "trustind1", "theolscale"),
                        list(paranorm.med, birther.inteff, "inteff", "theolscale"),
                        list(paranorm.med, birther.exteff, "exteffic", "theolscale"),
                        list(paranorm.med, birther.RWA, "RWA", "theolscale"))

mediate.list <- function(k) {
  i <- mediate(model.m=k[[1]],
               model.y=k[[2]],
               treat = k[[3]],
               mediator=k[[4]],
               sims=500)
  return(data.frame(acme = i$d0,
                    ade = i$z0,
                    te = i$tau.coef,
                    te.lo = i$tau.ci[1],
                    te.hi = i$tau.ci[2]))
}



vapres <- ldply(vap.list2, mediate.list, .progress = "text")
truthres <- ldply(truth.list2, mediate.list, .progress = "text")
iraqres <- ldply(iraq.list2, mediate.list, .progress = "text")
fincrisisres <- ldply(fincrisis.list2, mediate.list, .progress = "text")
cflbres <- ldply(cflb.list2, mediate.list, .progress = "text")
sorosres <- ldply(soros.list2, mediate.list, .progress = "text")
birtherres <- ldply(birther.list2, mediate.list, .progress = "text")


vapres$mediator <- rep(c("Manichean", "Endtimes", "Supernatural", "Cabal", "Paranormal"), each = 14)
vapres$indvar <- c("Education", "Female", "Black", "Hispanic", "Liberal", "Conservative",
                   "Democrat", "Republican", "Political\nInterest", "Political\nKnowledge",
                   "Trust", "Internal\nEfficacy", "External\nEfficacy", "Authoritarianism")
vapres$conspiracy <- "Vapor Trails"


truthres$mediator <- rep(c("Manichean", "Endtimes", "Supernatural", "Cabal", "Paranormal"), each = 14)
truthres$indvar <- c("Education", "Female", "Black", "Hispanic", "Liberal", "Conservative",
                     "Democrat", "Republican", "Political\nInterest", "Political\nKnowledge",
                     "Trust", "Internal\nEfficacy", "External\nEfficacy", "Authoritarianism")
truthres$conspiracy <- "Truther"


iraqres$mediator <- rep(c("Manichean", "Endtimes", "Supernatural", "Cabal", "Paranormal"), each = 14)
iraqres$indvar <- c("Education", "Female", "Black", "Hispanic", "Liberal", "Conservative",
                    "Democrat", "Republican", "Political\nInterest", "Political\nKnowledge",
                    "Trust", "Internal\nEfficacy", "External\nEfficacy", "Authoritarianism")
iraqres$conspiracy <- "Iraq War"


fincrisisres$mediator <- rep(c("Manichean", "Endtimes", "Supernatural", "Cabal", "Paranormal"), each = 14)
fincrisisres$indvar <- c("Education", "Female", "Black", "Hispanic", "Liberal", "Conservative",
                         "Democrat", "Republican", "Political\nInterest", "Political\nKnowledge",
                         "Trust", "Internal\nEfficacy", "External\nEfficacy", "Authoritarianism")
fincrisisres$conspiracy <- "Fin.Crisis"


cflbres$mediator <- rep(c("Manichean", "Endtimes", "Supernatural", "Cabal", "Paranormal"), each = 14)
cflbres$indvar <- c("Education", "Female", "Black", "Hispanic", "Liberal", "Conservative",
                    "Democrat", "Republican", "Political\nInterest", "Political\nKnowledge",
                    "Trust", "Internal\nEfficacy", "External\nEfficacy", "Authoritarianism")
cflbres$conspiracy <- "CFLB"


sorosres$mediator <- rep(c("Manichean", "Endtimes", "Supernatural", "Cabal", "Paranormal"), each = 14)
sorosres$indvar <- c("Education", "Female", "Black", "Hispanic", "Liberal", "Conservative",
                     "Democrat", "Republican", "Political\nInterest", "Political\nKnowledge",
                     "Trust", "Internal\nEfficacy", "External\nEfficacy", "Authoritarianism")
sorosres$conspiracy <- "Soros"

birtherres$mediator <- rep(c("Manichean", "Endtimes", "Supernatural", "Cabal", "Paranormal"), each = 14)
birtherres$indvar <- c("Education", "Female", "Black", "Hispanic", "Liberal", "Conservative",
                       "Democrat", "Republican", "Political\nInterest", "Political\nKnowledge",
                       "Trust", "Internal\nEfficacy", "External\nEfficacy", "Authoritarianism")
birtherres$conspiracy <- "Birther"


bdf <- rbind(vapres, truthres, iraqres, fincrisisres, cflbres, sorosres, birtherres)

# first, a df for the mediated and direct effects

bdm1 <- melt(bdf[,c(1,2,6,7,8)], id = 3:5)

table(bdm1$indvar)
bdm1$indvar <- factor(bdm1$indvar, 
                      levels= c("Education",
                                "Female",
                                "Black",
                                "Hispanic",
                                "Liberal",
                                "Conservative",
                                "Democrat",
                                "Republican",
                                "Political\nInterest",
                                "Political\nKnowledge",
                                "Trust",
                                "Internal\nEfficacy",
                                "External\nEfficacy",
                                "Authoritarianism"))

bdm1$conspiracy[bdm1$conspiracy == "Vapor Trails"] <- "Chem.Trails"
table(bdm1$conspiracy)
bdm1$conspiracy <- factor(bdm1$conspiracy, 
                          levels= c("Truther",
                                    "Iraq War",
                                    "Fin.Crisis",
                                    "CFLB",
                                    "Chem.Trails",
                                    "Soros",
                                    "Birther"))


table(bdm1$mediator)


bdm1$mediator2 <- car::recode(bdm1$mediator,
                              "
                              'Cabal' = 'C';
                              'Endtimes' = 'E';
                              'Manichean' = 'M';
                              'Paranormal' = 'P' ;
                              'Supernatural' = 'S'
                              ", 
                              levels = c("S","M","E","C","P"),
                              as.factor.result = T)
table(bdm1$mediator2)
table(bdm1$variable)

bdm1$variable2 <- as.character(bdm1$variable)
bdm1$variable2[bdm1$variable2 == "acme"] <- "Average Causal\nMediated Effect"
bdm1$variable2[bdm1$variable2 == "ade"] <- "Average Direct\nEffect"
class(bdm1$variable2)

bdm1$variable3 <- as.character(bdm1$variable)
bdm1$variable3[bdm1$variable3 == "acme"] <- "Average Causal Mediated Effect"
bdm1$variable3[bdm1$variable3 == "ade"] <- "Average Direct Effect"
class(bdm1$variable3)


bdf <- rbind(vapres, truthres, iraqres, fincrisisres, cflbres, sorosres, birtherres)



bdm1 <- melt(bdf[,c(1,2,6,7,8)], id = 3:5)

table(bdm1$indvar)
bdm1$indvar <- factor(bdm1$indvar, 
                      levels= c("Education",
                                "Female",
                                "Black",
                                "Hispanic",
                                "Liberal",
                                "Conservative",
                                "Democrat",
                                "Republican",
                                "Political\nInterest",
                                "Political\nKnowledge",
                                "Trust",
                                "Internal\nEfficacy",
                                "External\nEfficacy",
                                "Authoritarianism"))

bdm1$conspiracy[bdm1$conspiracy == "Vapor Trails"] <- "Chem.Trails"
table(bdm1$conspiracy)
bdm1$conspiracy <- factor(bdm1$conspiracy, 
                          levels= c("Truther",
                                    "Iraq War",
                                    "Fin.Crisis",
                                    "CFLB",
                                    "Chem.Trails",
                                    "Soros",
                                    "Birther"))


table(bdm1$mediator)


bdm1$mediator2 <- car::recode(bdm1$mediator,
                              "
                              'Cabal' = 'C';
                              'Endtimes' = 'E';
                              'Manichean' = 'M';
                              'Paranormal' = 'P' ;
                              'Supernatural' = 'S'
                              ", 
                              levels = c("S","M","E","C","P"),
                              as.factor.result = T)
table(bdm1$mediator2)
table(bdm1$variable)

bdm1$variable2 <- as.character(bdm1$variable)
bdm1$variable2[bdm1$variable2 == "acme"] <- "Average Causal\nMediated Effect"
bdm1$variable2[bdm1$variable2 == "ade"] <- "Average Direct\nEffect"
class(bdm1$variable2)

bdm1$variable3 <- as.character(bdm1$variable)
bdm1$variable3[bdm1$variable3 == "acme"] <- "Average Causal Mediated Effect"
bdm1$variable3[bdm1$variable3 == "ade"] <- "Average Direct Effect"
class(bdm1$variable3)


sp1 <- dcast(bdm1, indvar+mediator+conspiracy~variable, value.var= "value")
sp1$toteffect <- abs(sp1$ade) + abs(sp1$acme)
sp1$medprop <- abs(sp1$acme)/sp1$toteffect



bdm1$value1 <- abs(bdm1$value)

sp2 <- dcast(bdm1, indvar~mediator+conspiracy,fun.aggregate=sum, value.var= "value1")
sp2$maxtoteffect <- adply(sp2[,-1], 1, function(i) max(abs(i)))$V1


sp4 <- merge(sp1, sp2[,c(1,37)], by="indvar", all.x = T)

sp4 <- mutate(sp4, effectratio = toteffect/maxtoteffect,
              dotsize = medprop * toteffect)


bdm2 <- merge(bdm1, sp4[,c("indvar","mediator","conspiracy","dotsize")], by = c("mediator", "indvar", "conspiracy"), all.x =T)

p1.1 <- ggplot(bdm2) + geom_point(aes(y = value, x = mediator2, shape = variable3, size = dotsize)) + 
  facet_grid(indvar ~ conspiracy, scales= "free_y") +
  scale_shape_manual("", values = c(1,16)) +
  geom_hline(yintercept = 0, linetype  = 2) +
  theme_bw() +
  opts(strip.text.y = theme_text(),
       legend.position = "bottom",
       legend.direction= "horizontal",
       legend.box = "horizontal") +
  scale_x_discrete("Mediating Predisposition") +
  scale_y_continuous("Effect Size") +
  scale_size_continuous("Proportion of effect mediated*ratio of total effect\nto variable's largest effect on any conspiracy", range=c(2.5, 5.5))


# Not Run 
# ggsave("mediated effects plot2-size effects2.pdf", 
#        plot=p1.1, 
#        width = 14, 
#        height = 10)
